trait Logger{
              def log(message:String){Unit
                 
    }
    }
class Calculator extends Logger{
    
            def add(x:Int, y:Int):Int={
                val a=x+y
                log(s" $x + $y= $a")
                a
}
            def subtract(x:Int, y:Int):Int={
               val b=x-y
               log(s" $x - $y= $b")
               b
}
override def log(message: String): Unit = {
    println(message)
  }
}
object Test{
  def main(args:Array[String]){
     var calculator =new Calculator()
     calculator.add(10,5)
     calculator.subtract(10,5)}
     }
